<template>
  <div>
    <div><h1>MV</h1></div>
    <div class="mv">
      <div class="item" v-for="item of MV" :key="item.id">
        <div class="img"><img :src="item.program.coverUrl" alt="" /></div>
        <div class="mv_name">{{ item.program.name }}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
     data() {
    return {
      MV: [],
    };
  },
  mounted() {
    this.$http.get("http://47.108.197.28:3000/dj/program/toplist").then((res) => {
      console.log(res.data.toplist);
      this.MV=res.data.toplist
    });
  },
}
</script>

<style>
.mv {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}
.item {
  margin: 10px;
  width: 100px;
}
.img{
    width: 100px;
    height: 100px;
}
.item img {
  width: 100%;
  height: 100%;
}
.mv_name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 10px;
}
</style>